<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:composite="http://java.sun.com/jsf/composite"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:p="http://primefaces.org/ui"
      xmlns:ui="http://java.sun.com/jsf/facelets">
	<h:body>
    	<ui:composition template="/resources/template/layout.xhtml" >
    		<ui:define name="contentLayout" >
    			<p:spacer height="10" style="display:block" />

			
				<p:selectOneMenu value="#{serviceFlowController.serviceID}" rendered="#{serviceFlowController.selectView}">
						<f:selectItem itemLabel="Select a service" itemValue="-1" />
						<f:selectItems value="#{serviceFlowController.services}" var="service"
							itemLabel="#{service.virtualServiceName} - #{service.virtualServiceCategory}" itemValue="#{service.serviceID}" />
						<p:ajax event="change" update=":form-layout:flowTree" listener="#{serviceFlowController.reload}" />
				</p:selectOneMenu>
				<p:spacer height="10" style="display:block" />    			 
    			
    			 
    			<p:outputPanel id="expiredPanel" autoUpdate="true" style="float: right;" >
    				<h:outputText value="Expired on #{serviceFlowController.expiredOnSecs} sec" styleClass="bold" style="font-size:14px !important" rendered="#{serviceFlowController.expiredOnSecs > 0}" />
    				<h:outputText value="Default ADP" styleClass="bold" style="font-size:14px !important" rendered="#{0 > serviceFlowController.expiredOnSecs}"/> 
    			</p:outputPanel> 
    			    			 
    			<p:mindmap id="flowTree" value="#{serviceFlowController.root}" style="width:100%;height:400px;border:1px solid black;" styleClass="mindMapfont">
        			<p:ajax event="select" listener="#{serviceFlowController.onNodeSelect}" />
   				</p:mindmap>
   				
  				<p:dialog widgetVar="details" header="Node Details" resizable="false" modal="true" showEffect="fade" hideEffect="fade">
        			<h:outputText id="output" value="#{serviceFlowController.selectedNode.data}" />
    			</p:dialog>
    		</ui:define>
    	</ui:composition>
    </h:body>
</html>